package com.zhouyu;

import com.zhouyu.mybatis.spring.WangFactoryBean;
import com.zhouyu.service.UserMybatisService;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.core.io.Resource;

/**
 * @author mimao funfind@yeah.net
 * @date ${{
 */
public class TestMybatis {

	public static void main(String[] args) {
//		Resources

		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
		AbstractBeanDefinition beanDefinition = BeanDefinitionBuilder.genericBeanDefinition().getBeanDefinition();
		beanDefinition.setBeanClass(WangFactoryBean.class);
		beanDefinition.getConstructorArgumentValues().addGenericArgumentValue(UserMybatisService.class);
		context.registerBeanDefinition("userMapper",beanDefinition);    //userMapper----UserMapper代理对象


	}
}
